define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'knscy.activity/index',
        add_url: 'knscy.activity/add',
        edit_url: 'knscy.activity/edit',
        delete_url: 'knscy.activity/delete',
        export_url: 'knscy.activity/export',
        modify_url: 'knscy.activity/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'ID'},
                    {field: 'sort', title: '排序', edit: 'text'},
                    {field: 'cover', title: '图片', templet: ea.table.image,search: false},
                    {field: 'title', title: '标题名称',minWidth:200},
                    {field: 'sub_title', title: '副标题',minWidth:200},
                    {field: 'total_nums', title: '总报名人数',minWidth: 150,search: false},
                    {field: 'start_time', title: '开始时间',minWidth: 150,search: "range"},
                    {field: 'end_time', title: '结束时间',minWidth: 150,search: "range"},
                    {field: 'status', search: 'select', selectList: ["禁用","启用"], title: '状态', templet: ea.table.switch},
                    {field: 'create_time', title: '创建时间',search: "range"},
                    {fixed:"right",width: 200, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});